#!/bin/bash

SFILE="/space/outputlogsTerry1000B1000M/ARFF_scaleHist_10_0.0001.csv-100-S.mat"
VFILE="/space/outputlogsTerry1000B1000M/ARFF_scaleHist_10_0.0001.csv-100-V.mat"

SVDSCRIPT="/home/yacin/tivo-classifier/svd/svd.py"
RCLASSIFY="/home/yacin/tivo-classifier/classify.R"

if [[ $# -ne 2 ]]; then
    echo "usage: ./train.sh NUM_FACTORS ARFF_*.csv"
    exit 2
fi

echo "Running SVD on the training set"
sudo python $SVDSCRIPT -cv -f $1 $2 > $2.$1.svd
R < $RCLASSIFY  --vanilla --args $2.$1.svd >/dev/null
